package com.credit.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.common.ServerResponse;
import com.credit.mapper.companyQualificationMapper;
import com.credit.mapper.copyWriterMapper;
import com.credit.pojo.companyQualification;
import com.credit.pojo.copyWriter;
import com.credit.pojo.user;
import com.credit.service.ISettingsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class SettingsServiceImpl implements ISettingsService{

	@Autowired
	private companyQualificationMapper companyQualificationMapper;
	
	@Autowired
	private copyWriterMapper copyWriterMapper;
	
	
	
	public ServerResponse deleteCompanyQualification(Integer id) {

		return ServerResponse.createBySuccess(companyQualificationMapper.deleteCompanyQualification(id));
	}

	public ServerResponse insertCompanyQualification(companyQualification record) {

		return ServerResponse.createBySuccess(companyQualificationMapper.insertCompanyQualification(record));
	}

	public ServerResponse selectCompanyQualification(Integer id) {
		
		return ServerResponse.createBySuccess(companyQualificationMapper.selectCompanyQualification(id));
	}

	public ServerResponse updateCompanyQualification(companyQualification record) {
	
		return ServerResponse.createBySuccess(companyQualificationMapper.updateCompanyQualification(record));
	}

	
	
	
	
	
	
	
	
	public ServerResponse deleteCopyWriter(Integer id) {
		
		return ServerResponse.createBySuccess(copyWriterMapper.deleteCopyWriter(id));
	}

	public ServerResponse insertCopyWriter(copyWriter record) {
		
		return ServerResponse.createBySuccess(copyWriterMapper.insertCopyWriter(record));
	}

	public ServerResponse selectCopyWriter(copyWriter record, int pageNum, int pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		 
		 List<copyWriter> list=copyWriterMapper.selectCopyWriter(record);
		 
		 PageInfo pageInfo = new PageInfo(list);
		
		 return ServerResponse.createBySuccess(pageInfo);
	}

	public ServerResponse selectOneCopyWriter(Integer id) {
		
		return ServerResponse.createBySuccess(copyWriterMapper.selectOneCopyWriter(id));
	}

	public ServerResponse updateCopyWriter(copyWriter record) {
		
		return ServerResponse.createBySuccess(copyWriterMapper.updateCopyWriter(record));
	}

	
	
	
	
	
	

}
